#pragma once

#include "common_def.h"

#include <iostream>
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
#include <ctime>


// 地毯大小信息类
typedef struct TagCarpetSize{
public:
    double length, width, start_line;

    struct TagCarpetSize(double l, double w, double st_l = 0) : length(l), width(w), start_line(st_l) {}
}CarpetSize;


class Carpet
{
public:
    Carpet(const cv::Mat& img, const CarpetSize& carpet_size);
    cv::Mat Carpet::homography(const std::vector<Point>& corner);
    std::vector<Point> Carpet::getCarpetCorner();
    std::Vector2d Carpet::transferImgPoint2HomoPoint(const Point& score_point);
    double Carpet::getFinalScore(const Point& score_point, bool save_img = false);

private:
    Point homobox_topleft;
    cv::Mat img;
    CarpetSize carpet_size;
    cv::Mat homo_matrix;

};